{template 'header', 'member'}
    <!--right start-->
    <div class="right layout-right fn-right">
        <p class="tips bd-gray c666">专用于广大企业用户发布广告信息</p>
        <!--main-block start-->
        <div class="main-block bd-gray mt10">
            <div class="hd fn-clear">
                <h2 class="fn-left">广告发布</h2>
            </div>
            <ul id="data-nav" class="main-nav mt10 fn-clear">
                <li class="current"><a href="ad.php?action=add">购买广告位</a></li>
                <li><a href="ad.php">编辑广告位</a></li>
            </ul>

            <!--购买广告位 start-->
            <form id="ad-buy-form" method="post" action="ad.php" >
            <input type="hidden" name="action" value="{$action}"/>
            <table class="data-form mt10 con">
                <tbody>
                <tr>
                    <th width="100"><span class="cred">*</span>投放位置：</th>
                    <td>
                        <input id="site-main" name="post[site]" class="nobd fn-left mr5" type="radio" value="1" {if !$p[nation_price]||$placeHasSationMain} disabled="disabled"{else} checked="true"{/if}>
                        <label for="site-main" class="fn-left mr10">主站</label>
                        <input id="site-sub" name="post[site]" class="nobd fn-left mr5" type="radio" value="2" {if !$p[subnation_price]||!$placeResidueCity}disabled="disabled"{/if}{if !$p[nation_price]||$placeHasSationMain} checked="true"{/if}>
                        <label for="site-sub" class="fn-left">分站</label>
                    </td>
                </tr>
                <tr>
                    <th><span class="cred">*</span>广告位：</th>
                    <td>
                        <select id="ads-type" name="post[pid]" class="easyui-validatebox">
                            <option value="0">选择广告位</option>
                            {loop $ads $adsValue}
                            <option value="{$adsValue[pid]}" data-url="ad.php?action=add&pid={$adsValue[pid]}" {if $pid==$adsValue[pid]}selected="selected"{/if}>{$adsValue["name"]}[{$adsValue["typename"]}]</option>
                            {/loop}
                        </select>
                    </td>
                </tr>
                {if $placeResidueCity && $p['subnation_price']}
                <tr id="ads-prov" {if $p[nation_price]&&!$placeHasSationMain} class="fn-hide"{/if}>
                    <th><span class="cred">*</span>省份：</th>
                    <td>
                        <div class="ad-prov bd-gray fn-clear">
                        {loop $placeResidueProvince $province}
                            <label class="fn-left"><input name="ad-prov" class="nobd fn-left mr5" type="checkbox" value="{$province[areaid]}"> {$province["areaname"]}</label>
                        {/loop}
                        </div>
                    </td>
                </tr>
                {/if}
                <tr id="ads-city" class="fn-hide">
                    <th><span class="cred">*</span>分站：</th>
                    <td>
                        <div class="ad-prov ad-city bd-gray fn-clear">
                        </div>
                    </td>
                </tr>
                <tr>
                    <th><span class="cred">*</span>购买时长：</th>
                    <td>
                        <input name="post[time]" id="ads-time" type="text" size="10" {if $p[nation_price]&&!$placeHasSationMain} value="1"{/if} class="easyui-validatebox">
                        <select name="post[timetype]">
                            <option value="2">年</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th></th>
                    <td class="ad-price">
                        <input type="hidden" id="ads-price" {if $p[nation_price]&&!$placeHasSationMain} value="{$p[nation_price]}"{/if}>
                        共计  <span id="ads-total">{if $p[nation_price]&&!$placeHasSationMain}{$p[nation_price]}{/if}</span>  元
                    </td>
                </tr>
                <tr>
                    <th></th>
                    <td>
                        <div class="ad-rule bd-gray">
                            <h2>网站注册服务条款</h2>
                            <p>尊敬的用户，欢迎您注册成为本网站用户。在注册前请。欢迎您注册成为本网站用户欢迎您注册成为本网站用户欢迎您注册成为本网站用户欢迎您注册成为本网站用户欢迎您注册成为本网站用户。。。。</p>
                            <p>尊敬的用户，欢迎您注册成为本网站用户。在注册前请。。。。。</p>
                            <p>尊敬的用户，欢迎您注册成为本网站用户。在注册前请。。。。。</p>
                        </div>
                        <p class="mt10"><label for="ad-rule-agree" class="fn-right"><input id="ad-rule-agree" class="nobd fn-left mr5" type="checkbox"> 我同意以上服务条款</label></p>
                    </td>
                </tr>
                <tr>
                    <th></th>
                    <td>
                       <button name="submit" id="ad-buy-sbt" type="submit" class="btn fn-left mr20 btn-dis" value="购买">购买</button>
                       <a type="button" class="btn fn-left mr20">退出</a>
                    </td>
                </tr>
                </tbody>
            </table>
            </form>
            <script>
                seajs.use(['$','easyui','easyui-css','easyui-icon-css'],function($){
                    $("#ad-buy-sbt").click(function(){
                        if($(this).hasClass("btn-dis")) return false;
                        $('.easyui-validatebox').each(function(){
                            var title = $(this).attr("title");
                            $(this).validatebox({
                                required:true,
                                missingMessage:title
                            });
                        });
                        return $("#ad-buy-form").form('validate');
                    });
                })
            </script>
            <!--购买广告位 end-->
        </div>
        <!--main-block end-->
    </div>
    <!--right end-->
    {template 'footer', $module}